\(\int \cos ^3(a+b x) \cot (a+b x) \, dx\) [122]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 15, antiderivative size = 38 \[ \int \cos ^3(a+b x) \cot (a+b x) \, dx=-\frac {\text {arctanh}(\cos (a+b x))}{b}+\frac {\cos (a+b x)}{b}+\frac {\cos ^3(a+b x)}{3 b} \]

[Out]

-arctanh(cos(b*x+a))/b+cos(b*x+a)/b+1/3*cos(b*x+a)^3/b

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {2672, 308, 212} \[ \int \cos ^3(a+b x) \cot (a+b x) \, dx=-\frac {\text {arctanh}(\cos (a+b x))}{b}+\frac {\cos ^3(a+b x)}{3 b}+\frac {\cos (a+b x)}{b} \]

[In]

Int[Cos[a + b*x]^3*Cot[a + b*x],x]

[Out]

-(ArcTanh[Cos[a + b*x]]/b) + Cos[a + b*x]/b + Cos[a + b*x]^3/(3*b)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 308

Int[(x_)^(m_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Int[PolynomialDivide[x^m, a + b*x^n, x], x] /; FreeQ[{a,
b}, x] && IGtQ[m, 0] && IGtQ[n, 0] && GtQ[m, 2*n - 1]

Rule 2672

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, a*(Sin[e + f*x]/ff)
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rubi steps \begin{align*} \text {integral}& = -\frac {\text {Subst}\left (\int \frac {x^4}{1-x^2} \, dx,x,\cos (a+b x)\right )}{b} \\ & = -\frac {\text {Subst}\left (\int \left (-1-x^2+\frac {1}{1-x^2}\right ) \, dx,x,\cos (a+b x)\right )}{b} \\ & = \frac {\cos (a+b x)}{b}+\frac {\cos ^3(a+b x)}{3 b}-\frac {\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (a+b x)\right )}{b} \\ & = -\frac {\text {arctanh}(\cos (a+b x))}{b}+\frac {\cos (a+b x)}{b}+\frac {\cos ^3(a+b x)}{3 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 60, normalized size of antiderivative = 1.58 \[ \int \cos ^3(a+b x) \cot (a+b x) \, dx=\frac {5 \cos (a+b x)}{4 b}+\frac {\cos (3 (a+b x))}{12 b}-\frac {\log \left (\cos \left (\frac {1}{2} (a+b x)\right )\right )}{b}+\frac {\log \left (\sin \left (\frac {1}{2} (a+b x)\right )\right )}{b} \]

[In]

Integrate[Cos[a + b*x]^3*Cot[a + b*x],x]

[Out]

(5*Cos[a + b*x])/(4*b) + Cos[3*(a + b*x)]/(12*b) - Log[Cos[(a + b*x)/2]]/b + Log[Sin[(a + b*x)/2]]/b

Maple [A] (verified)

Time = 0.10 (sec) , antiderivative size = 37, normalized size of antiderivative = 0.97

method result size
parallelrisch \(\frac {12 \ln \left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )\right )+16+\cos \left (3 b x +3 a \right )+15 \cos \left (b x +a \right )}{12 b}\) \(37\)
derivativedivides \(\frac {\frac {\left (\cos ^{3}\left (b x +a \right )\right )}{3}+\cos \left (b x +a \right )+\ln \left (\csc \left (b x +a \right )-\cot \left (b x +a \right )\right )}{b}\) \(38\)
default \(\frac {\frac {\left (\cos ^{3}\left (b x +a \right )\right )}{3}+\cos \left (b x +a \right )+\ln \left (\csc \left (b x +a \right )-\cot \left (b x +a \right )\right )}{b}\) \(38\)
norman \(\frac {\frac {4 \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}+\frac {4 \left (\tan ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}+\frac {8}{3 b}}{\left (1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )^{3}}+\frac {\ln \left (\tan \left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{b}\) \(70\)
risch \(\frac {5 \,{\mathrm e}^{i \left (b x +a \right )}}{8 b}+\frac {5 \,{\mathrm e}^{-i \left (b x +a \right )}}{8 b}+\frac {\ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b}-\frac {\ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )}{b}+\frac {\cos \left (3 b x +3 a \right )}{12 b}\) \(77\)

[In]

int(cos(b*x+a)^4/sin(b*x+a),x,method=_RETURNVERBOSE)

[Out]

1/12*(12*ln(tan(1/2*b*x+1/2*a))+16+cos(3*b*x+3*a)+15*cos(b*x+a))/b

Fricas [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.32 \[ \int \cos ^3(a+b x) \cot (a+b x) \, dx=\frac {2 \, \cos \left (b x + a\right )^{3} + 6 \, \cos \left (b x + a\right ) - 3 \, \log \left (\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right ) + 3 \, \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2}\right )}{6 \, b} \]

[In]

integrate(cos(b*x+a)^4/sin(b*x+a),x, algorithm="fricas")

[Out]

1/6*(2*cos(b*x + a)^3 + 6*cos(b*x + a) - 3*log(1/2*cos(b*x + a) + 1/2) + 3*log(-1/2*cos(b*x + a) + 1/2))/b

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 473 vs. \(2 (29) = 58\).

Time = 0.88 (sec) , antiderivative size = 473, normalized size of antiderivative = 12.45 \[ \int \cos ^3(a+b x) \cot (a+b x) \, dx=\begin {cases} \frac {3 \log {\left (\tan {\left (\frac {a}{2} + \frac {b x}{2} \right )} \right )} \tan ^{6}{\left (\frac {a}{2} + \frac {b x}{2} \right )}}{3 b \tan ^{6}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 3 b} + \frac {9 \log {\left (\tan {\left (\frac {a}{2} + \frac {b x}{2} \right )} \right )} \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )}}{3 b \tan ^{6}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 3 b} + \frac {9 \log {\left (\tan {\left (\frac {a}{2} + \frac {b x}{2} \right )} \right )} \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )}}{3 b \tan ^{6}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 3 b} + \frac {3 \log {\left (\tan {\left (\frac {a}{2} + \frac {b x}{2} \right )} \right )}}{3 b \tan ^{6}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 3 b} + \frac {12 \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )}}{3 b \tan ^{6}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 3 b} + \frac {12 \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )}}{3 b \tan ^{6}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 3 b} + \frac {8}{3 b \tan ^{6}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{4}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 9 b \tan ^{2}{\left (\frac {a}{2} + \frac {b x}{2} \right )} + 3 b} & \text {for}\: b \neq 0 \\\frac {x \cos ^{4}{\left (a \right )}}{\sin {\left (a \right )}} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(b*x+a)**4/sin(b*x+a),x)

[Out]

Piecewise((3*log(tan(a/2 + b*x/2))*tan(a/2 + b*x/2)**6/(3*b*tan(a/2 + b*x/2)**6 + 9*b*tan(a/2 + b*x/2)**4 + 9*
b*tan(a/2 + b*x/2)**2 + 3*b) + 9*log(tan(a/2 + b*x/2))*tan(a/2 + b*x/2)**4/(3*b*tan(a/2 + b*x/2)**6 + 9*b*tan(
a/2 + b*x/2)**4 + 9*b*tan(a/2 + b*x/2)**2 + 3*b) + 9*log(tan(a/2 + b*x/2))*tan(a/2 + b*x/2)**2/(3*b*tan(a/2 +
b*x/2)**6 + 9*b*tan(a/2 + b*x/2)**4 + 9*b*tan(a/2 + b*x/2)**2 + 3*b) + 3*log(tan(a/2 + b*x/2))/(3*b*tan(a/2 +
b*x/2)**6 + 9*b*tan(a/2 + b*x/2)**4 + 9*b*tan(a/2 + b*x/2)**2 + 3*b) + 12*tan(a/2 + b*x/2)**4/(3*b*tan(a/2 + b
*x/2)**6 + 9*b*tan(a/2 + b*x/2)**4 + 9*b*tan(a/2 + b*x/2)**2 + 3*b) + 12*tan(a/2 + b*x/2)**2/(3*b*tan(a/2 + b*
x/2)**6 + 9*b*tan(a/2 + b*x/2)**4 + 9*b*tan(a/2 + b*x/2)**2 + 3*b) + 8/(3*b*tan(a/2 + b*x/2)**6 + 9*b*tan(a/2
+ b*x/2)**4 + 9*b*tan(a/2 + b*x/2)**2 + 3*b), Ne(b, 0)), (x*cos(a)**4/sin(a), True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.21 \[ \int \cos ^3(a+b x) \cot (a+b x) \, dx=\frac {2 \, \cos \left (b x + a\right )^{3} + 6 \, \cos \left (b x + a\right ) - 3 \, \log \left (\cos \left (b x + a\right ) + 1\right ) + 3 \, \log \left (\cos \left (b x + a\right ) - 1\right )}{6 \, b} \]

[In]

integrate(cos(b*x+a)^4/sin(b*x+a),x, algorithm="maxima")

[Out]

1/6*(2*cos(b*x + a)^3 + 6*cos(b*x + a) - 3*log(cos(b*x + a) + 1) + 3*log(cos(b*x + a) - 1))/b

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 101 vs. \(2 (36) = 72\).

Time = 0.31 (sec) , antiderivative size = 101, normalized size of antiderivative = 2.66 \[ \int \cos ^3(a+b x) \cot (a+b x) \, dx=\frac {\frac {8 \, {\left (\frac {3 \, {\left (\cos \left (b x + a\right ) - 1\right )}}{\cos \left (b x + a\right ) + 1} - \frac {3 \, {\left (\cos \left (b x + a\right ) - 1\right )}^{2}}{{\left (\cos \left (b x + a\right ) + 1\right )}^{2}} - 2\right )}}{{\left (\frac {\cos \left (b x + a\right ) - 1}{\cos \left (b x + a\right ) + 1} - 1\right )}^{3}} + 3 \, \log \left (\frac {{\left | -\cos \left (b x + a\right ) + 1 \right |}}{{\left | \cos \left (b x + a\right ) + 1 \right |}}\right )}{6 \, b} \]

[In]

integrate(cos(b*x+a)^4/sin(b*x+a),x, algorithm="giac")

[Out]

1/6*(8*(3*(cos(b*x + a) - 1)/(cos(b*x + a) + 1) - 3*(cos(b*x + a) - 1)^2/(cos(b*x + a) + 1)^2 - 2)/((cos(b*x +
 a) - 1)/(cos(b*x + a) + 1) - 1)^3 + 3*log(abs(-cos(b*x + a) + 1)/abs(cos(b*x + a) + 1)))/b

Mupad [B] (verification not implemented)

Time = 1.47 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.63 \[ \int \cos ^3(a+b x) \cot (a+b x) \, dx=\frac {\ln \left (\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )\right )}{b}+\frac {4\,{\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^4+4\,{\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^2+\frac {8}{3}}{b\,{\left ({\mathrm {tan}\left (\frac {a}{2}+\frac {b\,x}{2}\right )}^2+1\right )}^3} \]

[In]

int(cos(a + b*x)^4/sin(a + b*x),x)

[Out]

log(tan(a/2 + (b*x)/2))/b + (4*tan(a/2 + (b*x)/2)^2 + 4*tan(a/2 + (b*x)/2)^4 + 8/3)/(b*(tan(a/2 + (b*x)/2)^2 +
 1)^3)